The next example shows how a single path shape can contain more than one path contour. The path shape defined in this example includes the round path from the previous example as well as a second round path, entirely contained within the first.
This is shown in Figure 13 .
Figure 13 A path shape with two concentric clockwise contours and closed-frame shape fill
If you don't specify a shape fill, you get the shape fill from the default path shape, which is the even-odd shape fill. The path shape resulting from an even-odd shape fill is shown in Figure 14 .
Figure 14 Two concentric clockwise contours and even-odd shape fill
Notice that the even-odd shape fill causes the fill of the outer contour, but not the inner contour. However, if you specify the winding shape fill for this path, the resulting shape would appear as shown in Figure 15 .
Figure 15 Two concentric clockwise contours and winding shape fill
Unlike the even-odd shape fill, the winding shape fill causes QuickDraw GX to fill inner contours-- as long as the inner contour has the same contour direction as the outer contour . If the inner contour and the outer contour have opposite contour directions, neither the even-odd shape fill nor the winding shape fill will fill the inner contour.
For example, if you change the direction of the inner contour from the previous example by reversing the order of the second path's geometric points and set the shape fill to the closed-frame shape fill, the resulting shape has contours with opposite contour directions, as depicted in Figure 16 .
Figure 16 Internal counterclockwise contour and closed-frame shape fill
Since the outer contour and the inner contour have opposite contour directions, neither the even-odd shape fill nor the winding shape fill cause QuickDraw GX to fill the inner contour, as shown in Figure 17 .
Figure 17 A path shape with even-odd or winding shape fill
| Previous | Chapter Contents | Chapter Top | Next |